package com.bjt.wms.sys.controller;

import com.bjt.utils.R;
import com.bjt.wms.sys.service.MenuService;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.kit.Kv;

/**
 * @author WenbinJi
 * <p>
 * 菜单管理
 */
public class MenuController extends Controller {

    @Inject
    private MenuService menuService;

    public void getMenu() {
        String[] menuTypes = {"wms", "contentManagement", "memberCenter", "systemeSttings", "seraphApi"};
        Kv kv = Kv.create();
        for (String menuType : menuTypes) {
            kv.put(menuType, menuService.getMenu(menuType));
        }
        renderJson(R.ok().put("menu", kv));
    }

    public void queryMenuList() {
        renderJson(R.ok().put("data", menuService.getMenuList("wms")));
    }
}
